package cn.iocoder.yudao.module.product.dal.mysql.skuofferpricerelation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.dal.dataobject.skuofferpricerelation.SkuOfferPriceRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.skuofferpricerelation.vo.*;

/**
 * sku与报价关系 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SkuOfferPriceRelationMapper extends BaseMapperX<SkuOfferPriceRelationDO> {

    default PageResult<SkuOfferPriceRelationDO> selectPage(SkuOfferPriceRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SkuOfferPriceRelationDO>()
                .eqIfPresent(SkuOfferPriceRelationDO::getSkuId, reqVO.getSkuId())
                .eqIfPresent(SkuOfferPriceRelationDO::getPrice, reqVO.getPrice())
                .eqIfPresent(SkuOfferPriceRelationDO::getIncompletePrice, reqVO.getIncompletePrice())
                .eqIfPresent(SkuOfferPriceRelationDO::getEnable, reqVO.getEnable())
                .betweenIfPresent(SkuOfferPriceRelationDO::getEffectiveTime, reqVO.getEffectiveTime())
                .eqIfPresent(SkuOfferPriceRelationDO::getEffective, reqVO.getEffective())
                .eqIfPresent(SkuOfferPriceRelationDO::getCurrentMark, reqVO.getCurrentMark())
                .betweenIfPresent(SkuOfferPriceRelationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SkuOfferPriceRelationDO::getId));
    }

}